/**
 * 文件上传组件使用 author: 吴青
 */
$(function() {
	var fileUploadHTMLID="file_upload_1";
	var $form=$("#"+fileUploadHTMLID).parent();
	$("#"+fileUploadHTMLID).uploadify(
			{
				height : 27,
				fileObjName: 'fileData',
				fileTypeDesc : 'Excel,Word,PDF文件',
				fileTypeExts : '*.xls; *.xlsx;*.doc;*.docx;*.pdf', 
				swf : 'jsLib/uploadify/uploadify.swf',
				uploader : 'uploadify.action',
				width : 60,
				buttonText : '选择文件',
				uploadLimit :3, 
				fileSizeLimit:'1MB',
				//removeTimeout : 3, // 提示信息显示的时间，单位秒
				removeCompleted:false,
				progressData : 'percentage',
				
				onUploadSuccess : function(file, data, response) {
					var jsonResonse=eval("("+data+")");
					$("<input type='hidden' class='input_"+file.id+"' name='updateFileName' />").val(jsonResonse.updateFileName).appendTo($form);
					
					$("<input type='hidden' class='input_"+file.id+"' name='savedFileName' />").val(jsonResonse.savedFileName).appendTo($form);
		        },
		        deleteItem:function(id){
		        	$form.find(".input_"+id).remove();
		        }

			});
});
